/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tesis.domain;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author hectdx
 */
@Entity
@Table(name = "alarma")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Alarma.findAll", query = "SELECT a FROM Alarma a"),
    @NamedQuery(name = "Alarma.findByIdalarma", query = "SELECT a FROM Alarma a WHERE a.idalarma = :idalarma"),
    @NamedQuery(name = "Alarma.findByIndactivo", query = "SELECT a FROM Alarma a WHERE a.indactivo = :indactivo"),
    @NamedQuery(name = "Alarma.findByFechacreacion", query = "SELECT a FROM Alarma a WHERE a.fechacreacion = :fechacreacion")})
public class Alarma implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "fechacreacion")
    @Temporal(TemporalType.DATE)
    private Date fechacreacion;
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "idalarma")
    private Integer idalarma;
    @Basic(optional = false)
    @NotNull
    @Column(name = "indactivo")
    private char indactivo;
    @JoinColumn(name = "idinstanciaestacion", referencedColumnName = "idinstanciaestacion")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private InstanciaEstacion idinstanciaestacion;

    public Alarma() {
    }

    public Alarma(Integer idalarma) {
        this.idalarma = idalarma;
    }

    public Alarma(Integer idalarma, char indactivo, Date fechacreacion) {
        this.idalarma = idalarma;
        this.indactivo = indactivo;
        this.fechacreacion = fechacreacion;
    }

    public Integer getIdalarma() {
        return idalarma;
    }

    public void setIdalarma(Integer idalarma) {
        this.idalarma = idalarma;
    }

    public char getIndactivo() {
        return indactivo;
    }

    public void setIndactivo(char indactivo) {
        this.indactivo = indactivo;
    }

    public InstanciaEstacion getIdinstanciaestacion() {
        return idinstanciaestacion;
    }

    public void setIdinstanciaestacion(InstanciaEstacion idinstanciaestacion) {
        this.idinstanciaestacion = idinstanciaestacion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idalarma != null ? idalarma.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Alarma)) {
            return false;
        }
        Alarma other = (Alarma) object;
        if ((this.idalarma == null && other.idalarma != null) || (this.idalarma != null && !this.idalarma.equals(other.idalarma))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tesis.domain.Alarma[ idalarma=" + idalarma + " ]";
    }

    public Date getFechacreacion() {
        return fechacreacion;
    }

    public void setFechacreacion(Date fechacreacion) {
        this.fechacreacion = fechacreacion;
    }
    
}
